﻿using System;
using Game1942.Library.Background;
using Game1942.Library.Background.Bodies;
using Game1942.Library.FlightPlans;

namespace Game1942.Library.Weapons
{
    class Torpedo : Ammo
    {
        public Torpedo(bool playerTeam)
            : base(playerTeam)
        {
            damage = Constants.Torpedo.Damage;

            manageTurn.SetSpeed(Constants.Torpedo.Speed);
            body = new Square(Constants.Torpedo.Width, Constants.Torpedo.Height);
            position.SetBody(body);
            flightPlan.Speed = Constants.Torpedo.Speed;
        }
        public Torpedo(Point aPosition, bool playerTeam, bool homing)
            : this(playerTeam)
        {
            if (homing)
            {
                flightPlan = new HomingStrategy(Constants.Torpedo.Speed, Driver.Instance.Player.ActualPosition);
            }
            base.SetPosition(aPosition);
        }

    }
}
